Skip to content

Conversation

hannahkm
Copy link
Contributor

@hannahkm hannahkm commented Sep 5, 2025

  • Added msgp struct tags to fields in payloadV1 and traceChunk for serialization.
  • Introduced EncodeMsg methods for payloadV1 and spanListV1 to support msgp encoding.
  • Updated field types in traceChunk to enhance compatibility with msgp serialization.

What does this PR do?

Implements the v1 trace protocol. Includes commits cherry-picked from #3932 since I closed my previous PR.

Motivation

https://datadoghq.atlassian.net/browse/LANGPLAT-750

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

- Added msgp struct tags to fields in payloadV1 and traceChunk for serialization.
- Introduced EncodeMsg methods for payloadV1 and spanListV1 to support msgp encoding.
- Updated field types in traceChunk to enhance compatibility with msgp serialization.
@pr-commenter
Copy link

pr-commenter bot commented Sep 5, 2025

Benchmarks

Benchmark execution time: 2025-09-30 17:53:19

Comparing candidate commit 60165d3 in PR branch hannahkm/implement-v1-serialization with baseline commit 25440fd in branch hannahkm/msgp-payload-interface.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 23 metrics, 1 unstable metrics.

Copy link
Contributor

datadog-official bot commented Sep 5, 2025

⚠️ Tests

⚠️ Warnings

🧪 3 Tests failed

TestPayloadV1Decode from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestPayloadV1Decode
--- FAIL: TestPayloadV1Decode (0.05s)
TestPayloadV1Decode/10 from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestPayloadV1Decode/10
    payload_test.go:106: 
        	Error Trace:	D:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/payload_test.go:106
        	Error:      	Received unexpected error:
        	            	msgp: attempted to decode type "int" with method for "array"
        	Test:       	TestPayloadV1Decode/10
    payload_test.go:108: 
        	Error Trace:	D:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/payload_test.go:108
...
TestPayloadV1Decode/1024 from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog) (✨ Fix with BitsAI)
Failed

=== RUN   TestPayloadV1Decode/1024
    payload_test.go:106: 
        	Error Trace:	D:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/payload_test.go:106
        	Error:      	Received unexpected error:
        	            	msgp: attempted to decode type "int" with method for "array"
        	Test:       	TestPayloadV1Decode/1024
    payload_test.go:108: 
        	Error Trace:	D:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/payload_test.go:108
...

ℹ️ Info

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 60165d3 | Docs | Was this helpful? Give us feedback!

// }
if protocol == traceProtocolV1 {
return &safePayload{
p: newPayloadV1(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond the linter errors, this is looking in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants